// 放置路由配置
// 将vue框架和vue-router插件导入
import Vue from 'vue'
import VueRouter from 'vue-router'
// 导入组件
import HeroList from '../components/HeroList'
import HeroAdd from '../components/HeroAdd'
import HeroEdit from '../components/HeroEdit'
import JnList from '../components/JnList'
import ZbList from '../components/ZbList'

// 很重要 通过Vue.use方法注册vue-router插件
Vue.use(VueRouter)

// 使用路由的步骤

// 1. 定义路由和组件的关系
const routes = [
  { path: '/heroList', component: HeroList, name: 'herolist' },
  { path:'/heroAdd',component:HeroAdd,name:'heroadd'},
  { path:'/heroEdit',component:HeroEdit,name:'heroedit'},
  { path: '/jnList', component: JnList, name: 'jnList' },
  { path: '/zbList', component: ZbList, name: 'zblist' }
]


// 2. 实例化路由router出来

const router = new VueRouter({
  routes
})

// 3. 将路由实例router传入根实例挂载上去即可
// 把router实例导出去

export default router